admin: Install grub2 config file if we detect /etc/grub.d
authorColin Walters <walters@verbum.org>
Mon, 1 Oct 2012 23:34:25 +0000 (19:34 -0400)
committerColin Walters <walters@verbum.org>
Mon, 1 Oct 2012 23:34:25 +0000 (19:34 -0400)
Decouple this from the kernel postinst one, since it's possible to
have one but not the other.

Makefile-ostree.am
configure.ac

index 6b3b3b9bae026fb9b4ce03c05bcce4a42f1a8c9c..0cd821d8ee222f701fccab3d615539805d4f9e79 100644 (file)
@@ -75,11 +75,15 @@ endif
 
 MANPAGES += doc/ostree.1
 
-if ENABLE_KERNEL_UPDATES
+if ENABLE_GRUB2_HOOK
 
 grub2dir = $(sysconfdir)/grub.d
 grub2_SCRIPTS = src/ostree/grub2/15_ostree
 
+endif
+
+if ENABLE_KERNEL_UPDATES
+
 kernelpostinstdir = $(sysconfdir)/kernel/postinst.d
 kernelpostinst_SCRIPTS = src/ostree/kernel/15_ostree_update
 
index 05d89061f6fe157925f96487657496569d1804e8..b9577e657676bf83fdf3bb216b7e0d1304b4816b 100644 (file)
@@ -112,7 +112,7 @@ AS_IF([ test x$with_libarchive != xno ], [
 ], [ with_libarchive=no ])
 AM_CONDITIONAL(USE_LIBARCHIVE, test $with_libarchive != no)
 
-AS_IF([test x$cross_compiling != xyes && test -d /etc/kernel && test x$enable_triggers_only != xno ],
+AS_IF([test x$cross_compiling != xyes && test -d /etc/kernel && test x$enable_triggers_only != xyes ],
       [kernel_updates_default=yes],
       [kernel_updates_default=no])
 
@@ -123,6 +123,16 @@ AC_ARG_ENABLE(kernel-updates,
              enable_kernel_updates=${kernel_updates_default})
 AM_CONDITIONAL(ENABLE_KERNEL_UPDATES, test $enable_kernel_updates != no)
 
+AS_IF([test x$cross_compiling != xyes && test -d /etc/grub.d && test x$enable_triggers_only != xyes ],
+      [grub2_hook_default=yes],
+      [grub2_hook_default=no])
+
+AC_ARG_ENABLE(grub2-hook,
+              AS_HELP_STRING([--enable-grub2-hook],
+             [Install GRUB2 hook]), ,
+             enable_grub2_hook=${grub2_hook_default})
+AM_CONDITIONAL(ENABLE_GRUB2_HOOK, test $enable_grub2_hook != no)
+
 AC_CONFIG_FILES([
 Makefile
 embedded-dependencies/Makefile
@@ -140,4 +150,5 @@ echo "
     libarchive (parse tar files directly): $with_libarchive
     documentation: $enable_documentation
     kernel updates integration: $enable_kernel_updates
+    GRUB2 hook: $enable_grub2_hook
 "